package day19.tarena.io;

import java.io.FileInputStream;
import java.io.FileOutputStream; //	write file

/**
 * 
 * @author wang.peihu
 * 
 */

public class TestCopy {
	public static void main(String[] args) throws Exception {

		for (int j = 0; j < 6; j++) {
			FileInputStream fis = new FileInputStream("../../ok" + j);
			for (int i = 0; i < 10; i++) {
				byte[] b = new byte[10240];
				FileOutputStream fos = new FileOutputStream("../../LK", true);
				int num = fis.read(b);
				if (num == -1)
					break;
				fos.write(b, 0, num);
				fos.close();
			}
			fis.close();
		}

			FileInputStream fis = new FileInputStream("../../1.jpg");
			
		for (int i = 0; i < 10; i++) {
			byte[] b = new byte[10240];
			FileOutputStream fos = new FileOutputStream("../../ok" + i);
			int num = fis.read(b);
			if (num == -1)	break;
			fos.write(b, 0, num);
			fos.close();
		}
		fis.close();
	}
}


	
	